package com.zmn.oms.business.interfaces.order;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.bo.order.OrderBO;
import com.zmn.oms.model.dto.order.OrderDTO;
import com.zmn.oms.model.dto.order.OrderUserDetailDTO;
import com.zmn.oms.model.dto.product.OrderProductDTO;
import com.zmn.oms.model.entity.detail.OrderDetail;
import com.zmn.oms.model.entity.order.Order;
import com.zmn.oms.model.entity.product.OrderProduct;
import com.zmn.uuc.common.dro.user.UserBaseDRO;
import org.springframework.scheduling.annotation.Async;

import java.util.List;

/**
 * 类描述：订单
 *
 * @author liuying
 * @date 2018/11/07 09:36
 */
public interface OrderBService {

    /**
     * 产品处理
     * @param orderProductDTO
     * @return
     */
    void processBeforeOrderProduct(OrderProductDTO orderProductDTO);

    /**
     * 订单处理
     *
     * @param orderDTO
     * @throws OmsBaseException
     */
    void processOrder(OrderDTO orderDTO) throws OmsBaseException;

    /**
     * 订单处理
     *
     * @param orderDTO
     * @throws OmsBaseException
     */
    void processPlaceAnOrderDefaultServItem(OrderDTO orderDTO) throws OmsBaseException;

    /**
     * 修改订单
     *
     * @param orderDTO
     * @return
     */
    OrderBO updateOrder(OrderDTO orderDTO);

    /**
     * 新增订单
     *
     * @param orderDTO
     * @return
     */
    OrderBO insertOrder(OrderDTO orderDTO);

    /**
     * 同步订单
     * @param orderId
     */
    @Async
    void syncOrder(Long orderId);

    /**
     * 订单处理地址
     *
     * @param orderDTO
     * @throws OmsBaseException
     */
    void processOrderAddress(OrderDTO orderDTO) throws OmsBaseException;

    /**
     * 修改地址
     *
     * @param orderDTO
     * @return
     */
    OrderBO updateOrderAddress(OrderDTO orderDTO) throws OmsBaseException;


    /**
     * 查询下单用户信息
     *
     * @param userType
     * @param userId
     * @return
     */
    OrderUserDetailDTO getUserInfo(Integer userType, Long userId);


    /**
     * 通过手机号查询下单用户信息
     *
     * @param mobiles
     * @return
     */
    List<UserBaseDRO> getUserInfoByMobile(List<String> mobiles);
}
